<?php
/**
 * 后台接口基础类
 * by Obelisk
 */
	namespace app\libs;
    use yii;
    use yii\web\Controller;
	class ContentControl extends Controller {
		public function init() {
            header('Access-Control-Allow-Origin: *');
            header('Access-Control-Allow-Credentials:true');
            header('Access-Control-Allow-Headers: X-Requested-With');
            header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
            header("Content-type: text/html; charset=utf-8");

            $this->config();
            $session  = Yii::$app->session;
            $userId   = $session->get('adminId');
            // 无登录无法进入后台
            // if(!$userId){
            //     $this->redirect('/admin/login/index');
            // }else{
            //     $this->role();
            // }
		}
        public function config(){
            define('baseUrl',Yii::$app->params['baseUrl']);
            define('tablePrefix',Yii::$app->db->tablePrefix);
        }
 
 

    }
?>
